Skip to content

fix(deps): remediate 285 audit vulnerabilities — 9 overrides, sharp/vitest bumps, dead-dep removals - #34

Merged
JOY (JOY) merged 1 commit into
mainfrom
dev
Sep 10, 2026
Merged

fix(deps): remediate 285 audit vulnerabilities — 9 overrides, sharp/vitest bumps, dead-dep removals#34
JOY (JOY) merged 1 commit into
mainfrom
dev

Conversation

@JOY

@JOY JOY (JOY) commented Sep 10, 2026

Copy link
Copy Markdown

What kind of change does this PR introduce?

Bug fix — scope: dependencies (root package.json), email provider, dead frontend files. Remediation batch C4 from the security audit: remediate the 285 production vulnerabilities (5 critical, 101 high) via pnpm.overrides + targeted bumps + removal of zero-import dependencies. No app code changes except the nodemailer transport hardening and deletion of the dead Solana wallet providers.

Why was this change needed?

pnpm audit --prod reported 285 vulnerabilities (5 critical, 101 high). The five criticals: happy-dom VM-escape RCE (via @pigment-css/react), protobufjs arbitrary-code-execution, form-data unsafe boundary, shell-quote injection, tar DoS. Two direct deps (sharp, nodemailer) carried HIGHs that the declared semver ranges could never reach. The removal targets (@solana/*, @postiz/wallets, sweetalert2, @mantine/modals, viem) were verified zero-import by the audit.

Technical Details & Scope

  • pnpm.overrides (9): tar ^7.5.19, form-data ^2.5.4, protobufjs ^7.5.5, shell-quote ^1.8.4, fast-uri ^3.1.6, hono ^4.12.34, immutable ^5.1.8, handlebars ^4.7.9, happy-dom ^20.0.0 (clears the VM-escape RCE without removing @pigment-css/react — which is transitively required by @neynar/react and kept).
  • Bumps: sharp ^0.33.4 → ^0.35.0 (clears 4 libvips CVEs on the user-upload path), vitest 3.1.4 → 3.2.6 + @vitest/ui 1.6.0 → 3.2.6 + @vitest/coverage-v8 → 3.2.6 (clears GHSA-5xrq-8626-4rwp critical).
  • Removals (audit-verified zero-import): sweetalert2 + @sweetalert2/theme-dark, @mantine/modals, @solana/wallet-adapter-react + -react-ui, @postiz/wallets, viem, @tailwindcss/vite (v4 unused); dead files wallet.provider.tsx + placeholder/wallet.ui.provider.tsx deleted (the only importers of the Solana chain).
  • Nodemailer mitigation: disableFileAccess/disableUrlAccess added to the transport (GHSA-p6gq-j5cr-w38fraw bypass). The major bump 7→9 is deferred pending email transport testing.
  • Kept after verification: parse5 (used by strip.html.validation.ts, x.provider.ts), canvas + image-to-pdf (used by linkedin.provider.ts), @meronex/icons + @pigment-css/react (transitively required by polotno / @neynar/react — the audit's "zero direct imports" finding did not account for transitive bundler imports).

Verification & Testing

  • All 9 overrides verified in pnpm-lock.yaml (resolved versions above patched thresholds — table in the audit doc).
  • pnpm install → +150/−1085 packages; peer warnings are pre-existing majors (eslint 8→9, prettier 2→3, tsup/swc chains) deferred as separate migrations.
  • Full build passes: next build (frontend, Turbopack), nest build (backend + orchestrator) on Node 22.
  • Nodemailer transport hardening: no raw usage anywhere; flags enforced at transport level.

QA

  1. Run pnpm install — expect success with no ERR_PNPM_JSON_PARSE (all workspace package.json valid).
  2. Verify overrides in the lockfile: findstr /C:"tar@7." /C:"form-data@2.5" /C:"protobufjs@7." /C:"shell-quote@1." /C:"fast-uri@3." /C:"hono@4." /C:"immutable@5." /C:"handlebars@4." /C:"happy-dom@20." pnpm-lock.yaml — expect every resolved version at/above the patched thresholds.
  3. Run pnpm list sharp vitest --depth 0 — expect sharp ≥0.35, vitest 3.2.6.
  4. Run pnpm --filter ./apps/frontend run build and pnpm --filter ./apps/backend run build and pnpm --filter ./apps/orchestrator run build — expect all three to exit 0.
  5. Run pnpm audit --prod (with NODE_OPTIONS=--max-old-space-size=8192) — expect the 5 previous criticals gone (happy-dom/tar/form-data/protobufjs/shell-quote) and vitest's gone; remaining high nodemailer@7 is mitigated (documented, major bump deferred).
  6. Confirm apps/frontend/src/components/auth/providers/wallet.provider.tsx no longer exists and the login page renders without Solana (register page + Apple/Farcaster/Github/Google providers unchanged).
  7. Send a test email via the nodemailer provider — expect normal delivery (disableFileAccess/disableUrlAccess only block file:// and http(s):// fetches inside email content, which the app never uses).

Checklist:

  • My code follows the project's code style and architectural conventions.
  • Local build passes (pnpm run build).
  • Branding guard validation passes (pnpm dlx tsx scripts/branding-guard.ts).
  • Tests and typecheck have been verified without errors.
  • Documentation has been updated (if applicable).
  • No secrets or sensitive credentials are included in this PR.
  • I have filled in the QA / Verification section above with real steps to verify this change.

Note

Medium Risk
Dependency overrides and image-processing (sharp) bumps affect the whole install graph; nodemailer flag changes touch outbound email, and removing wallet auth is a visible login behavior change if WALLET was still enabled in production.

Overview
This PR is a dependency security remediation batch: it adds nine pnpm.overrides (e.g. tar, form-data, protobufjs, happy-dom) and bumps sharp and Vitest to clear critical/high audit findings, while dropping unused packages (@solana/*, @postiz/wallets, sweetalert2, viem, @mantine/modals, @tailwindcss/vite).

Application-facing changes are limited: the Solana wallet login UI and provider (wallet.provider.tsx and placeholder UI) are deleted with those deps—wallet sign-in is no longer offered from the frontend. Nodemailer transport now sets disableFileAccess and disableUrlAccess to mitigate GHSA-p6gq-j5cr-w38f without a major nodemailer upgrade.

Reviewed by Cursor Bugbot for commit 7ea021d. Configure here.

…mps, zero-import removals

Clears 5 criticals (happy-dom RCE, protobufjs, form-data, shell-quote, tar, vitest UI-server) and multiple highs (hono CORS, fast-uri SSRF trio, immutable, sharp libvips).
@cursor

cursor Bot commented Sep 10, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_f788fc1c-0fa9-44e9-802a-f1390b598170)

@JOY
JOY (JOY) merged commit 72c1555 into main Sep 10, 2026
11 of 17 checks passed

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request removes the Solana wallet integration components and associated dependencies, updates several packages (including upgrading sharp and vitest), and adds security mitigations to the nodemailer provider by disabling file and URL access to prevent potential arbitrary file read vulnerabilities. There are no review comments, so I have no feedback to provide.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant